/**
 * 设置指定数据域状态对象
 * 
 * @param tag 
 * @param { tag, key, value }: { tag: string, key: string, value: any }
 */
export const setDataAreaState = (state: any, { tag, key, value }: { tag: string, key?: string, value?: any }) => {
    if(!key || !value || !state.stateData[tag]){
        state.stateData[tag] = {};
    }else{
        state.stateData[tag][key] = value;
    }
}

/**
 * 清除指定数据域状态对象
 * 
 * @param tag 
 */
export const clearDataAreaState = (state: any, tag: string) => {
    if (!state.stateData[tag]) {
        return;
    }
    delete state.stateData[tag];
}